<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
<!-- import tag properties JSTL & EL from JSP -->
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Manage Items</title>

<!-- CSS for addItem_Form.jsp -->
<style>
		label, input { display:inline-block; }
		input.text { margin-bottom:12px; width:95%; padding: .4em; }
		fieldset { padding:0; border:0; margin-top:25px; }
		.ui-dialog .ui-state-error { padding: .3em; }
		.validateTips { border: 1px solid transparent; padding: 0.3em; }
</style>

<!-- JQuery for JConfirmation -->	
<script type="text/javascript" src="<c:url value="/resources/script/jquery/jconfirmaction.jquery.js"/>"></script>
<script type="text/javascript">	
	$().ready(function() {
		$('.ask').jConfirmAction();
	});	
</script>
<!-- End of JConfirmation -->	
</head>
<body>
	<div>
		<form id="form" action="<c:url value="searchCategory"/>" method="post">
			<table>
				<tr>
					<th align="left"><h2>List of Category</h2>
					</th>
					<th><a class="bt_green"
						href="<c:url value="/master/category/insertCategory"/>"><span
							class="bt_green_lft"></span><strong>Add new Category</strong><span
							class="bt_green_r"></span>
					</a>
					</th>
				</tr>
				<tr>
					<td colspan="2">
						<table id="rounded-corner"
							summary="2007 Major IT Companies' Profit">
							<thead>
								<tr>
									<th scope="col" class="rounded-company"></th>
									<th scope="col" class="rounded"><b>Category Name</b>
									</th>
									<th scope="col" class="rounded"><b>Update</b>
									</th>
									<th scope="col" class="rounded-q4"><b>Delete</b>
									</th>
								</tr>
							</thead>

							<tbody>
								<c:forEach var="category" items="${categories}"
									varStatus="status">
									<tr>
										<td><input type="checkbox" name="" />
										</td>
										<td>${category.categoryName}</td>
										<td><a class="editItem"
											href="<c:url value="/master/category/detailCategory?id=${category.id}"/>"><img
												src="<c:url value="/resources/images/images/user_edit.png"/>" />
										</a>
										</td>
										<td><a class="ask"
											href="<c:url value="/master/category/deleteCategory?id=${category.id}"/>"><img
												src="<c:url value="/resources/images/images/trash.png"/>" />
										</a>
										</td>
									</tr>
								</c:forEach>
							</tbody>
							<tfoot>
						    	<tr>
						        	<td colspan="3" class="rounded-foot-left"><em>@Xsis Mitra Utama</em></td>
						        	<td class="rounded-foot-right">&nbsp;</td>
						
						        </tr>
						    </tfoot>	
						</table></td>
				</tr>
			</table>
		</form>
	</div>
	<br>
	<div>
		<p><font color="blue">Import data from Excel file:</font></p>
		<form action="upload" method="post" enctype="multipart/form-data"
			onSubmit="if(document.getElementById('fileinput').value == ''){alert('Choose file!'); return false;} ">
			<input size="70" type="file" name="spreadsheet" id="fileinput" /> 
			<input type="submit" value="Upload File" />
		</form>
	</div>
</body>
</html>
